<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Spring整合Quartz、Scheduler的任务调度系统">
    <meta name="keywords" content="Spring,Quartz,Scheduler,Job">
    <meta name="author" content="Yzh">
    <title>Schedule System</title>
    <link href="http://cdn.staticfile.org/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<header class="navbar navbar-static-top bs-docs-nav" id="top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <nav class="navbar-collapse collapse">
            <ul class="nav navbar-nav"></ul>
            <div class="jumbotron jumbotron-margin-top">
                <h3>Schedule System</h3>
            </div>
        </nav>
    </div>
</header>

<button type="button" class="btn btn-danger pull-right" data-toggle="modal" id="logout-btn">Exit</button>
<ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#schedule-job" aria-controls="schedule-job" role="tab" data-toggle="tab">Schedule job</a></li>
    <li role="presentation"><a href="#job-log" aria-controls="job-log" role="tab" data-toggle="tab">Job log</a></li>
</ul>

<div class="tab-content" role="main">
    <div class="container-fluid tab-pane fade" role="main" id="job-log">
        <button type="button" class="btn btn-success" title="刷新" id="job-log-refresh">Refresh</button>
        <table class="table table-bordered table-hover" data-url="api/job/log">
            <thead>
            <tr style="background-color: #b4b4b4;font-size: 20px">
                <!--<td>JobName</td>-->
                <td width="50px">Method</td>
                <td>URL</td>
                <td>Parameters</td>
                <td width="175px">TriggerTime</td>
                <td>TriggerCode</td>
                <td>TriggerMsg</td>
                <td width="175px">CallbackTime</td>
                <td>CallbackCode</td>
                <td>CallbackMsg</td>
            </tr>
            </thead>
            <tbody>
            </tbody>
            <tfoot>
            <tr>
                <!--<td data-name="jobName"></td>-->
                <td data-name="method"></td>
                <td data-name="url"></td>
                <td data-name="parameters"></td>
                <td data-name="triggerTime"></td>
                <td data-name="triggerCode"></td>
                <td data-name="triggerMsg">
                    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#job-log-modal" data-content="">detail</button>
                </td>
                <td data-name="callbackTime"></td>
                <td data-name="callbackCode"></td>
                <td data-name="callbackMsg"></td>
            </tr>
            </tfoot>
        </table>
    </div>

    <div class="container-fluid tab-pane fade in active" role="main" id="schedule-job">
        <select class="form-control" style="width: 200px" data-url="api/job/group" id="group">
            <option value="">All</option>
        </select>

        <button type="button" class="btn btn-danger do-post" title="暂停" data-url="pause">Pause</button>
        <button type="button" class="btn btn-primary do-post" title="恢复" data-url="resume">Resume</button>
        <button type="button" class="btn btn-info do-post" title="运行" data-url="run-once">Run-once</button>
        <button type="button" class="btn btn-warning" title="修改" data-toggle="modal" data-target="#schedule-job-modal" data-method="PUT" data-title="Modify Job">Modify</button>
        <button type="button" class="btn btn-success" data-toggle="modal" data-target="#schedule-job-modal" data-method="POST" >Add job</button>
        <button type="button" class="btn btn-success" title="复制" data-toggle="modal" data-target="#schedule-job-modal" data-method="CLONE" data-title="Add Job">Clone</button>

        <table class="table table-bordered table-hover" data-url="api/job">
            <thead>
            <tr style="background-color: #b4b4b4;font-size: 20px">
                <td>JobGroup</td>
                <td>JobName</td>
                <td>State</td>
                <td hidden>Disabled</td>
                <td>CronExpression</td>
                <td width="50px">Method</td>
                <td>URL</td>
                <td>Description</td>

                <td hidden width="165px">ContentType</td>
                <td hidden >Parameters</td>

                <td width="175px">TriggerTime</td>
                <td>TriggerCode</td>
                <td>TriggerMsg</td>
                <td>CallbackCode</td>
                <td>CallbackMsg</td>
            </tr>
            </thead>
            <tbody id="context">
            </tbody>
            <tfoot>
            <tr>
                <td data-name="jobGroup"></td>
                <td data-name="jobName"></td>
                <td data-name="state"></td>
                <td hidden data-name="disabled"></td>
                <td data-name="cronExpression"></td>
                <td data-name="method"></td>
                <td data-name="url"></td>
                <td data-name="description"></td>

                <td hidden data-name="contentType"></td>
                <td hidden data-name="parameters"></td>

                <td data-name="jobLog.triggerTime"></td>
                <td data-name="jobLog.triggerCode"></td>
                <td data-name="jobLog.triggerMsg">
                    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#job-log-modal" data-content="">detail</button>
                </td>
                <td data-name="jobLog.callbackCode"></td>
                <td data-name="jobLog.callbackMsg"></td>
            </tr>
            </tfoot>
        </table>
    </div>
</div>

<div class="modal fade" role="dialog" id="schedule-job-modal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form action="api/job" method="post" class="form-horizontal">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">Schedule job</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="id">
                    <div class="form-group">
                        <label for="jobGroup" class="col-sm-3 control-label">Job group</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="jobGroup" id="jobGroup">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="jobName" class="col-sm-3 control-label">Job name</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="jobName" id="jobName">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="cronExpression" class="col-sm-3 control-label">Cron expression</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="cronExpression" id="cronExpression">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="url" class="col-sm-3 control-label">URL</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="url" id="url">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="method" class="col-sm-3 control-label">Method</label>
                        <div class="col-sm-8">
                            <select class="form-control" name="method" id="method">
                                <option value="POST">POST</option>
                                <option value="GET">GET</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="contentType" class="col-sm-3 control-label">Content Type</label>
                        <div class="col-sm-8">
                            <select class="form-control" name="contentType" id="contentType">
                                <option value="application/json">application/json</option>
                                <option value="application/x-www-form-urlencoded">application/x-www-form-urlencoded</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="parameters" class="col-sm-3 control-label">Parameters</label>
                        <div class="col-sm-8">
                            <textarea type="text" class="form-control" rows="3" name="parameters" id="parameters" placeholder="JSON Format"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="description" class="col-sm-3 control-label">Description</label>
                        <div class="col-sm-8">
                            <textarea type="text" class="form-control" rows="2" name="description" id="description"></textarea>
                        </div>
                    </div>
                    <span class="col-sm-3" id="detail-message"></span>
                </div>
                <div class="modal-footer">
                    <button type="reset" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary submit-item">Save changes</button>
                </div>
            </form>
        </div>
    </div>
</div>


<div class="modal fade" tabindex="-1" role="dialog" id="job-log-modal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title text-center">Message</h3>
            </div>
            <div class="modal-body">
                <textarea type="text" readonly="true" class="form-control" rows="40"></textarea>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" tabindex="-1" role="dialog" id="login-modal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title text-center">Login</h3>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="method" class="col-sm-3 control-label">Username</label>
                    <div class="col-sm-8">
                        <input type="number" name="username" id="username" class="form-control">
                    </div>
                </div>
                <div class="form-group">
                    <label for="method" class="col-sm-3 control-label">Password</label>
                    <div class="col-sm-8">
                        <input type="password" name="password" id="password" class="form-control">
                    </div>
                </div>
                <span class="col-sm-3" id="long-message"></span>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success" id="login-btn">Sign in</button>
                <button type="reset" class="btn btn-default" data-dismiss="modal">Cancel</button>
            </div>
        </div>
    </div>
</div>

<footer class="bs-docs-footer">
    <div class="container-fluid"></div>
</footer>
<script src="//cdn.staticfile.org/jquery/3.5.1/jquery.min.js"></script>
<script src="//cdn.staticfile.org/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
<script src="js/login.js"></script>
<script src="js/curd.js"></script>
</body>
</html>